﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-trasitional.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>添加角色</title>
		<link rel="stylesheet"
			href="/static/css/table.css" type="text/css"/>
		<script type="text/javascript" src="/static/javascript/jquery-1.7.2.js"></script>
		<script type="text/javascript"
			src="/static/javascript/jquery.messager.js"></script>
		<script type="text/javascript" src="/static/javascript/right_add.js"></script>
		<!--以下3个js库必须按照顺序引入-->
		<!--vue脚本库-->
		<script type="text/javascript"
				src="/static/js/vue-3.2.4.global.js">
			<!--axios脚本库-->
		</script>
		<script type="text/javascript"
				src="/static/js/axios-0.18.0.min.js">
		</script>
		<!--我们自己封装的axios函数库 -->
		<script type="text/javascript"
				src="/static/js/axios-helper.js">
		</script>

		<script type="text/javascript" src="../../javascript/jquery-1.7.2.js"></script>
		<script type="text/javascript"
			src="../../javascript/jquery.messager.js"></script>
		<script type="text/javascript" src="../../javascript/right_add.js"></script>

	</head>
	<body id="app">
		<form method="post" action="success.html">
			<table width="100%">
				<tr>
					<td>
						<font color="black">您正在做的业务是：人力资源--权限管理--添加角色</font>
					</td>
				</tr>
				<tr>
					<td align="right">
						<input type="button" value="保存" @click="submit()" class="BUTTON_STYLE1"/>
						<input type="button" value="返回" class="BUTTON_STYLE1"
							onclick="history.back()">
					</td>
				</tr>
			</table>
			<table width="100%" border="1" cellpadding=3 cellspacing=1
				bordercolorlight=#848284 bordercolordark=#eeeeee
				class="TABLE_STYLE1">
				<tr>
					<td class="TD_STYLE1">角色名称</td>
					<td class="TD_STYLE2">
						<input type="text" v-model="role.rname"/>
					</td>
					<td class="TD_STYLE1">角色说明</td>
					<td class="TD_STYLE2">
						<input type="text" v-model="role.rdesc"/>
					</td>
				</tr>
				<tr>
					<td class="TD_STYLE1">角色是否可用</td>
					<td colspan="3" class="TD_STYLE2">
						<select v-model="role.isDisable">
							<option  :value="1" selected="selected">是</option>
							<option  :value="0">否</option>
						</select>
					</td>
				</tr>
			</table>
		</form>
	</body>
	<script type="module">
		Vue.createApp({
			data(){
				return{
					roleList:[],
					role:{
						//角色ID
						rId:null,
						//角色名称
						rname:null,
						//角色说明
						rdesc:null,
						//是否禁用(0 否-默认 1 是)
						isDisable:null
					}
				}
			},
			methods:{
				submit(){
					console.info(this.role)
					requestPostman("/role/save",this.role).then((data)=>{
						console.info(data);
						if(data.statusCode==1){
							// alert("保存成功");
							window.location.href = "/templates/page/power/successe.html";
						}else{
							alert("保存失败");
						}
					});
				}
			}
		}).mount("#app");
	</script>
</html>
